package com.cz.run.beans.mysql;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 订单表
 * </p>
 *
 * @author CAIYJ
 * @since 2018-05-23
 */
@TableName("order_info")
public class Order extends Model<Order> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 订单单号
     */
    @TableField("order_no")
    private String orderNo;
    /**
     * 商品ID
     */
    @TableField("product_id")
    private Integer productId;
    /**
     * 0：未付款,:1：已付款,2：已发货,3：已签收,-1：退货申请,-2：退货中,-3：已退货,-4：取消交易
     */
    @TableField("order_status")
    private Integer orderStatus;
    /**
     * 商品数量
     */
    @TableField("product_count")
    private Integer productCount;
    /**
     * 商品总价
     */
    @TableField("product_amount_total")
    private Double productAmountTotal;
    /**
     * 实际付款金额
     */
    @TableField("order_amount_total")
    private BigDecimal orderAmountTotal;
    /**
     * 运费金额
     */
    @TableField("logistics_fee")
    private BigDecimal logisticsFee;
    /**
     * 收货地址ID
     */
    @TableField("address_id")
    private Integer addressId;
    /**
     * 支付渠道
     */
    @TableField("pay_channel")
    private Integer payChannel;
    /**
     * 订单支付单号 
     */
    @TableField("out_trade_no")
    private String outTradeNo;
    /**
     * 下单时间
     */
    @TableField("create_time")
    private Date createTime;
    /**
     * 付款时间
     */
    @TableField("pay_time")
    private Date payTime;
    /**
     * 发货时间
     */
    @TableField("sent_time")
    private Date sentTime;
    /**
     * 用户ID
     */
    @TableField("user_id")
    private Integer userId;
    /**
     * 订单结算时间
     */
    @TableField("order_settlement_time")
    private Date orderSettlementTime;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    public Integer getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(Integer orderStatus) {
        this.orderStatus = orderStatus;
    }

    public Integer getProductCount() {
        return productCount;
    }

    public void setProductCount(Integer productCount) {
        this.productCount = productCount;
    }

    public Double getProductAmountTotal() {
        return productAmountTotal;
    }

    public void setProductAmountTotal(Double productAmountTotal) {
        this.productAmountTotal = productAmountTotal;
    }

    public BigDecimal getOrderAmountTotal() {
        return orderAmountTotal;
    }

    public void setOrderAmountTotal(BigDecimal orderAmountTotal) {
        this.orderAmountTotal = orderAmountTotal;
    }

    public BigDecimal getLogisticsFee() {
        return logisticsFee;
    }

    public void setLogisticsFee(BigDecimal logisticsFee) {
        this.logisticsFee = logisticsFee;
    }

    public Integer getAddressId() {
        return addressId;
    }

    public void setAddressId(Integer addressId) {
        this.addressId = addressId;
    }

    public Integer getPayChannel() {
        return payChannel;
    }

    public void setPayChannel(Integer payChannel) {
        this.payChannel = payChannel;
    }

    public String getOutTradeNo() {
        return outTradeNo;
    }

    public void setOutTradeNo(String outTradeNo) {
        this.outTradeNo = outTradeNo;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public Date getSentTime() {
        return sentTime;
    }

    public void setSentTime(Date sentTime) {
        this.sentTime = sentTime;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Date getOrderSettlementTime() {
        return orderSettlementTime;
    }

    public void setOrderSettlementTime(Date orderSettlementTime) {
        this.orderSettlementTime = orderSettlementTime;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "Order{" +
        ", id=" + id +
        ", orderNo=" + orderNo +
        ", productId=" + productId +
        ", orderStatus=" + orderStatus +
        ", productCount=" + productCount +
        ", productAmountTotal=" + productAmountTotal +
        ", orderAmountTotal=" + orderAmountTotal +
        ", logisticsFee=" + logisticsFee +
        ", addressId=" + addressId +
        ", payChannel=" + payChannel +
        ", outTradeNo=" + outTradeNo +
        ", createTime=" + createTime +
        ", payTime=" + payTime +
        ", sentTime=" + sentTime +
        ", userId=" + userId +
        ", orderSettlementTime=" + orderSettlementTime +
        "}";
    }
}
